package com.tanhua.dubbo.api;

import com.tanhua.domain.mongo.Peachblossom;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;


@Service
public class PeachblossomApiImpl implements PeachblossomApi {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Override
    public void save(Peachblossom peachblossom) {
        mongoTemplate.insert(peachblossom);
    }

    @Override
    public List<Peachblossom> findSoundList() {
        return mongoTemplate.findAll(Peachblossom.class);
    }

    @Override
    public void removeThisSound(Peachblossom peachblossom) {
        mongoTemplate.remove(peachblossom);
    }


}
